<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<%@ taglib uri="/WEB-INF/tld/ui.tld" prefix="ui" %>
<%@ taglib uri="/WEB-INF/tld/sys.tld" prefix="sys" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <c:set var="ctx" value="${pageContext.request.contextPath}"/>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>垫款单详情列表</title>
    <jsp:include page="../../import.jsp" flush="true"/>
    <script type="text/javascript">
        var pageInApp = {}; // to 下一级子窗口 接口
        var pageInTab = null;
        $(function () {
            initTab();
            initData();
        });

        function initData() {
            $("#ruleNm").html('${dkRuleInfoVO.ruleNm}');
            $("#billNm").html('${dkBillInfoVO.billNm}');
            var billStsCd = ${dkBillInfoVO.billStsCd};
            var billStsCdStr = "";
            if(billStsCd != null){
                if(billStsCd=='1')
                    billStsCdStr='垫款中';
                else if(billStsCd=='0')
                    billStsCdStr='结束';
            }
            $("#billStsCd").html(billStsCdStr);
            //日期处理
            if (${dkBillInfoVO.crtTm!= null}) {
                var date = new Date('${dkBillInfoVO.crtTm}');
                var dateStr = DateUtils.formatDate(date, "yyyy-MM-dd");
                $("#crtTm").html(dateStr);
            }
            $("#refPrjNm").html('${dkRuleInfoVO.refPrjNm}');
            var accTypCd = ${dkRuleInfoVO.accTypCd};
            var accTypCdStr = '';
            if(accTypCd != null){
                if(accTypCd == '1')
                    accTypCdStr = '承租人账户';
                else if(accTypCd == '2')
                    accTypCdStr = '我司账户';
                else if(accTypCd == '3')
                    accTypCdStr = '机构账户';
            }
            $("#accTypCd").html(accTypCdStr);
            $("#accId").html('${dkRuleInfoVO.accId}');
            var ransomExecCd = ${dkRuleInfoVO.ransomExecCd};
            var ransomExecCdStr = '';
            if(ransomExecCd!=null){
                if(ransomExecCd=='1')
                    ransomExecCdStr='标记赎回 ';
                else if(ransomExecCd='2'){
                    ransomExecCdStr='生成小贷账单 ';
                }
            }
            $("#ransomExecCd").html(ransomExecCdStr);
            var totalMaxQty = ${dkRuleInfoVO.totalMaxQty};
            if(totalMaxQty != null){
                if(totalMaxQty=='-1')
                    $("#totalMaxQty").html('无限制');
                else
                    $("#totalMaxQty").html(totalMaxQty);

            }
            var singleMaxQty = ${dkRuleInfoVO.singleMaxQty};
            if(singleMaxQty != null){
                if(singleMaxQty=='-1')
                    $("#singleMaxQty").html('无限制');
                else
                    $("#singleMaxQty").html(singleMaxQty);

            }
            $("#startOvedayDays").html('${dkRuleInfoVO.startOvedayDays}');
            $("#endOvedayDays").html('${dkRuleInfoVO.endOvedayDays}');
        }

        //设置页面数据
        function setData(data) {
            //状态
            if (data.billStsCd == 1) {
                $("#billStsCd").html("垫款中");
            } else if (data.billStsCd == 0) {
                $("#billStsCd").html("结束");
            }
            //日期处理
            if (data.crtTm) {
                var date = new Date(data.crtTm);
                var dateStr = DateUtils.formatDate(date, DateUtils.YYYY_MM_DD);
                $("#crtTm").html(dateStr);
            }
        };

        //初始化Tab页签
        function initTab() {
            pageInTab = $("#pageInTab").ligerTab({
                height: 'auto',
                contextmenu: false,
                minIframeHeight: GET_minIframeHeight(),
                onBeforeSelectTabItem: function (tabid) {
                },
                onAfterSelectTabItem: function (tabid) {
                    if (tabid != "tabA") {
                        console.log(tabid);
                        switch (tabid) {
                            case "tabB":
                                console.log(tabid)
                                pageInTab.setTabItemSrc(tabid, "<%=path%>/dk/dkbilldtl/toListPageDetail.do?billId=${dkBillInfoVO.id}");
                                break;
                        }
                        SetIframe_height();
                    }
                }
            });
            $.extend(true, pageInApp, {
                pageInTab: pageInTab
            });
        };

    </script>
</head>
<body class="iframeBody">
<div class="Wrapper">
    <div id="pageInTab" class="pageInTab">
        <div tabid="tabA" title="垫款规则信息" lselected="true">
            <div class="fieldset1 tabel_col clearFix">
                <div class="caption">
                    <span class="title">垫款规则信息</span>
                </div>

                <div class="fieldBox col_33">
                    <div class="label">规则名称</div>
                    <div class="field">
                        <span name="ruleNm" id="ruleNm">&nbsp;</span>
                    </div>
                </div>
                <div class="fieldBox col_33">
                    <div class="label">垫款单</div>
                    <div class="field">
                        <span name="billNm" id="billNm">&nbsp;</span>
                    </div>
                </div>
                <div class="fieldBox col_33">
                    <div class="label">状态</div>
                    <div class="field">
                        <span name="billStsCd" id="billStsCd">&nbsp;</span>
                    </div>
                </div>
                <div class="fieldBox col_33">
                    <div class="label">生成时间</div>
                    <div class="field">
                        <span name="crtTm" id="crtTm">&nbsp;</span>
                    </div>
                </div>
                <div class="fieldBox col_33">
                    <div class="label">再融资项目</div>
                    <div class="field">
                        <span name="refPrjNm" id="refPrjNm">&nbsp;</span>
                    </div>
                </div>
                <div class="fieldBox col_33">
                    <div class="label">收款账户</div>
                    <div class="field">
                        <span name="accTypCd" id="accTypCd">&nbsp;</span>
                    </div>
                </div>
                <div class="fieldBox col_33">
                    <div class="label">账户信息</div>
                    <div class="field">
                        <span name="accId" id="accId">&nbsp;</span>
                    </div>
                </div>
                <div class="fieldBox col_33">
                    <div class="label">赎回执行</div>
                    <div class="field">
                        <span name="ransomExecCd" id="ransomExecCd">&nbsp;</span>
                    </div>
                </div>
                <div class="fieldBox col_33">
                    <div class="label">最高垫款次数（累计）</div>
                    <div class="field">
                        <span name="totalMaxQty" id="totalMaxQty">&nbsp;</span>
                    </div>
                </div>
                <div class="fieldBox col_33">
                    <div class="label">最高垫款次数（单资产）</div>
                    <div class="field">
                        <span name="singleMaxQty" id="singleMaxQty">&nbsp;</span>
                    </div>
                </div>
            </div>

            <div class="fieldset1 tabel_col clearFix">
                <div class="caption">
                    <span class="title">逾期天数垫款目标</span>
                </div>
                <div class="fieldBox col_33">
                    <div class="label">起垫逾期天数（含）</div>
                    <div class="field">
                        <span name="startOvedayDays" id="startOvedayDays">&nbsp;</span>
                    </div>
                </div>
                <div class="fieldBox col_33">
                    <div class="label">最高逾期天数（含）</div>
                    <div class="field">
                        <span name="endOvedayDays" id="endOvedayDays">&nbsp;</span>
                    </div>
                </div>

            </div>
        </div>
        <div tabid="tabB" title="支付表信息" id="tabBId">
            <iframe frameborder="0" name="tabB" id="tabB" src=""></iframe>
        </div>
    </div>
</div>
</body>
</html>
